<?php
/**
* @software         [JiJinCMS]
* @author           [上海集锦信息科技有限公司]
* @website          [http://www.jijinweb.com]
* @email            [sunny@jijinweb.com]
**/
namespace app\admin\validate;
use think\validate;
use think\facade\Db;
use think\facade\Request;
class PageValidate extends validate{
    public $regex = [ 'checkName' => '/^\/[\w|\/|\-]+\.html$/i'];
    public $rule = [
        'name'  => ['require'],
        'classpath'  => ['require','unique'=>'cat','regex'=>'checkName'],        
        'template_id'  => ['require'],
        'pagetext'  => ['require'],        
    ];
    protected $message = [
        'name.require'=>'请填写模板名称',
        'template_id.require'=>'请选择模板',
        'pagetext.require'=>'请填写模板内容',
        'classpath.require'=>'URL路径必须填写！',
        'classpath.regex'=>'自定义链接枨错误，只能使用[数字，字母，_，- ，/],并以/开头和结尾',
        'classpath.unique'=>'URL路径已存在！',        
    ];
    
}

